<?php
abstract class Model {
	
	protected $_sqlInstance;
	
	public function __construct() {
		$this->_sqlInstance = Sql::getInstance();
		$this->_sqlInstance->getConnection();
	}
	
	public function selectAllIds($tableName , $where = '') {
		if(!$where) {
			$queryString = sprintf("
				SELECT 
					`id`
				FROM
					%s
			", $tableName);
		}
		else {
			$queryString = sprintf("
				SELECT 
					`id`
				FROM
					%s
				WHERE
					". $where ."
			", $tableName);
		}
		return $this->_sqlInstance->query($queryString); 
	}
}